#include <AVUITransform.h>

namespace AVUI {

/// <summary>Rotates an object clockwise about a specified point in a 2-D x-y coordinate system. </summary>
class RotateTransform : public Transform
{
public:
    DECLARE_ELEMENT(RotateTransform, Transform);

#pragma region Public Methods

    /// <summary>Initializes a new instance of the <see cref="T:System.Windows.Media.RotateTransform" /> class. </summary>
    RotateTransform() { };

    /// <summary>Initializes a new instance of the <see cref="T:System.Windows.Media.RotateTransform" /> class that has the specified angle, in degrees, of clockwise rotation. The rotation is centered on the origin, (0,0).  </summary>
    /// <param name="angle">The clockwise rotation angle, in degrees.</param>
    RotateTransform(float angle);

    /// <summary>Initializes a new instance of the <see cref="T:System.Windows.Media.RotateTransform" /> class that has the specified angle and center point.</summary>
    /// <param name="angle">The clockwise rotation angle, in degrees. For more information, see the <see cref="P:System.Windows.Media.RotateTransform.Angle" /> property.</param>
    /// <param name="centerX">The x-coordinate of the center point for the <see cref="T:System.Windows.Media.RotateTransform" />. For more information, see the <see cref="P:System.Windows.Media.RotateTransform.CenterX" /> property.</param>
    /// <param name="centerY">The y-coordinate of the center point for the <see cref="T:System.Windows.Media.RotateTransform" />. For more information, see the <see cref="P:System.Windows.Media.RotateTransform.CenterY" /> property.</param>
    RotateTransform(float angle, float centerX, float centerY);

    /// <summary>Creates a modifiable copy of this <see cref="T:System.Windows.Media.RotateTransform" /> by making deep copies of its values. </summary>
    /// <returns>A modifiable deep copy of the current object. The <see cref="P:System.Windows.Freezable.IsFrozen" /> property of the cloned object returns false even if the <see cref="P:System.Windows.Freezable.IsFrozen" /> property of the source is true.</returns>
    TRefCountedPtr<RotateTransform> Clone() { return (RotateTransform*) Transform::Clone().get_Ptr(); }

    /// <summary>Creates a modifiable copy of this <see cref="T:System.Windows.Media.RotateTransform" /> object by making deep copies of its values. This method does not copy resource references, data bindings, or animations, although it does copy their current values. </summary>
    /// <returns>A modifiable deep copy of the current object. The <see cref="P:System.Windows.Freezable.IsFrozen" /> property of the cloned object is false even if the <see cref="P:System.Windows.Freezable.IsFrozen" /> property of the source is true.</returns>
    TRefCountedPtr<RotateTransform> CloneCurrentValue() { return (RotateTransform*) Transform::CloneCurrentValue().get_Ptr(); }

#pragma endregion Public Methods

#pragma region Public Properties

    /// <summary>Gets or sets the angle, in degrees, of clockwise rotation. This is a dependency property. </summary>
    /// <returns>The angle, in degrees, of clockwise rotation. The default is 0.</returns>
    float get_Angle() { return AVUI::UnboxValue<float>(GetValue(get_AngleProperty())); }
    void set_Angle(float value) { SetValue(get_AngleProperty(), AVUI::BoxValue(value)); } 
    DECLARE_DEPENDENCY_PROPERTY(Angle);

    /// <summary>Gets or sets the x-coordinate of the rotation center point. This is a dependency property. </summary>
    /// <returns>The x-coordinate of the center of rotation. The default is 0.</returns>
    float get_CenterX() { return AVUI::UnboxValue<float>(GetValue(get_CenterXProperty())); }
    void set_CenterX(float value) { SetValue(get_CenterXProperty(), AVUI::BoxValue(value)); } 
    DECLARE_DEPENDENCY_PROPERTY(CenterX);

    /// <summary>Gets or sets the y-coordinate of the rotation center point. This is a dependency property. </summary>
    /// <returns>The y-coordinate of the center of rotation. The default is 0.</returns>
    DECLARE_DEPENDENCY_PROPERTY(CenterY);
    float get_CenterY() { return AVUI::UnboxValue<float>(GetValue(get_CenterYProperty())); }
    void set_CenterY(float value) { SetValue(get_CenterYProperty(), AVUI::BoxValue(value)); } 

    /// <summary>Gets the current rotation transformation as a <see cref="T:System.Windows.Media.Matrix" /> object. </summary>
    /// <returns>The current rotation transformation as a <see cref="T:System.Windows.Media.Matrix" />.</returns>
    virtual Matrix get_Value() AVUI_OVERRIDE;

#pragma endregion Public Properties

protected:

#pragma region Protected Methods

    virtual TRefCountedPtr<Freezable> CreateInstanceCore() AVUI_OVERRIDE { return object_allocate<RotateTransform>().get_Ptr(); }

#pragma endregion Protected Methods

public:

#pragma region Internal Properties

    virtual bool get_IsIdentity() AVUI_OVERRIDE;

#pragma endregion Internal Properties

private:
    static void StaticConstructor();

};


typedef TRefCountedPtr<RotateTransform> RotateTransformPtr;

}; // namespace AVUI
